<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body th:fragment="hasbei_top_user">

<div class="content-top" th:if="${auto!='11'}">
    <div class="content-top-info">
        <div class="content-top-left">
            <div class="left-logo">
                <a href="/" class="logo-info" target="_self"><img src="/icon/logo.png" alt="有贝口腔网"></a>
            </div>
            <ul class="right-list">
                <li><a href="/consult/main" target="_self"><img src="/icon/news-icon.png" alt="有贝口腔网"><span>资讯</span></a></li>
                <li><a href="/answers/main/-1/0" target="_self"><img src="/icon/qa-icon.png" alt="有贝口腔网"><span>问答</span></a></li>
            </ul>
        </div>
        <form action="http://www.hasbei.com/search" method="get">
            <div class="content-top-right">
                <div class="search-input">
                    <img class="search-icon" src="/icon/icon_Search.png">
                    <input class="top-search" type="text" name="kw" placeholder="请输入资讯、问题搜索" value="">
                    <input class="search-sub" type="submit" value="搜索">
                </div>


                <div class="land-success">
                    <script type="text/javascript">
                        $(function(){
                            getUserReadCount();
                        })
                        function getUserReadCount(){

                           /* $.post(basePath+"user/center/getNoReadCount",function(data){
                                var msgCount=0;
                                var html="<a href=\"/user/center/msgindex\">#type<span class=\"tips-num\">#count</span></a>";
                                var setHtml="";
                                $("#myNoticeModul").html(setHtml);
                                var list=data.data;
                                var size=list.length;
                                for(var i=0;i<size;i++){
                                    var type=list[i].type;
                                    var count=list[i].count;
                                    msgCount=msgCount+count;
                                    if(type==10){
                                        setHtml=html.replace("#type","文章审核").replace("#count",count);
                                    }else if(type==20){
                                        setHtml=html.replace("#type","提问审核").replace("#count",count);
                                    }else if(type==21){
                                        setHtml=html.replace("#type","回答审核").replace("#count",count);
                                    }
                                    $("#myNoticeModul").append(setHtml);
                                }
                                if(msgCount==0){
                                    setHtml=html.replace("#type","站内消息").replace("#count",msgCount);
                                    $("#myNoticeModul").append(setHtml);
                                }
                                $("#msgCount").html(msgCount);
                                if(msgCount>0){
                                    $(".notice-tip").show();
                                }else{
                                    $(".notice-tip").hide();
                                }
                            });*/
                            /* setTimeout(function(){
                                getUserReadCount();
                         },3000); */
                        }
                    </script>
                    <div class="message-notice">
                        <a href="http://www.hasbei.com/user/center/msgindex"><img src="/icon/notice.png" alt="有贝口腔网"><span class="notice-tip" id="msgCount" style="display:none">0</span></a>
                        <div class="notice-modul" id="myNoticeModul"><a href="/user_messages">站内消息<span class="tips-num">0</span></a></div>
                    </div>
                    <div class="land-success-img">
                        <a href="http://www.hasbei.com/user/center/index">
                            <img src="/img/3996076a3d6e46d48527eb1991b494cf.png">
                            <span class="land-success-name">无言猪</span>
                        </a>
                        <div class="img-posi-div">
                            <a href="/user/main"><span>个人信息</span></a>
                            <a href="javascript:;" onclick="loginOut()"><span>退出登录</span></a>
                        </div>
                    </div>

                </div>
            </div>
        </form>
    </div>
</div>

<script>
    function loginOut(){//退出登录

        $.post(basePath+"out",function(data){
            console.log(data)
            if(data=='ok'){
                layer.msg("退出成功");
                location.reload();
            }else{
                layer.msg("退出失败");
            }
        });
    }
</script>

</body>
</html>